<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="">
			<button type="button" onclick="Post();">POST测试</button>
			<button type="button" onclick="Get();">GET测试</button>
		</div>
		<div id="Book">
			
		</div>
	</body>
	<script type="text/javascript">
		function getTest(){
			var ajax = new XMLHttpRequest();
			ajax.open('GET','http://poetry.apiopen.top/getTime');
			ajax.send();
			ajax.onreadystatechange = function(){
				if(ajax.readyState==4 && ajax.status==200){
					var getTestObjectText = JSON.parse(ajax.responseText);
					if(getTestObjectText.code==200 && getTestObjectText.message=='成功!'){
						var BookObject = document.getElementById('Book');
						BookObject.innerText=getTestObjectText.result.dateTime+'--'+getTestObjectText.result.weekday;
					}
				}
			}
		}
	</script>
</html>
